package com.fitso.wicket.page.index;

import java.io.Serializable;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.FeedbackPanel;

import com.fitso.wicket.FitsoSession;
import com.fitso.wicket.panel.user.UserSignInPanel;
import com.fitso.wicket.panel.user.UserSignOutPanel;

/**
 * This is the page the user gets directed to when navigating to the home page.
 * 
 * @author timothystorm
 */
public class Index extends WebPage implements Serializable {
	// Only change on breaking changes, i.e., removing fields
	private static final long serialVersionUID = 1L;
	
	public Index() {
		add(new FeedbackPanel("FeedbackPanel"));

		if (FitsoSession.get().isSignedIn()) {
			add(new UserSignOutPanel("UserSignInOutPanel"));
		} else {
			add(new UserSignInPanel("UserSignInOutPanel"));
		}
	}
}
